using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Resources;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;

namespace KPIS.GERP.Models.ICM
{
	[DataContract, Table("IcmReceiveItem")]
    public class ReceiveItem
    {
        public ReceiveItem()
        {
            this.ReceiveItems = new HashSet<ReceiveItem>();
        }

		[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
		[DataMember, Display(Name = "RcItemId", ResourceType = typeof(Resources.ReceiveItemResource))]
        public int RcItemId { get; set; }

        [ForeignKey("Receive")]
		[DataMember, Display(Name = "ReceiveId", ResourceType = typeof(Resources.ReceiveItemResource))]
        public int ReceiveId { get; set; }

        [ForeignKey("DeliveryNoteItem")]
		[DataMember, Display(Name = "DnItemId", ResourceType = typeof(Resources.ReceiveItemResource))]
        public Nullable<int> DnItemId { get; set; }

		[DataMember, Display(Name = "LotNumber", ResourceType = typeof(Resources.ReceiveItemResource))]
        public string LotNumber { get; set; }

		[ForeignKey("ResItem")]
		[DataMember, Display(Name = "ResItemId", ResourceType = typeof(Resources.ReceiveItemResource))]
        public Nullable<int> ResItemId { get; set; }

		[DataMember, Display(Name = "SerialNumber", ResourceType = typeof(Resources.ReceiveItemResource))]
        public string SerialNumber { get; set; }

        [ForeignKey("ReceiveItem")]
		[DataMember, Display(Name = "UpperIcmRcItemId", ResourceType = typeof(Resources.ReceiveItemResource))]
        public Nullable<int> UpperIcmRcItemId { get; set; }

		[DataMember, Display(Name = "DateExpired", ResourceType = typeof(Resources.ReceiveItemResource))]
        public Nullable<System.DateTime> DateExpired { get; set; }

		[DataMember, Display(Name = "AutoConsume", ResourceType = typeof(Resources.ReceiveItemResource))]
        public string AutoConsume { get; set; }

        [ForeignKey("MasDepreciationType")]
		[DataMember, Display(Name = "DpTypeId", ResourceType = typeof(Resources.ReceiveItemResource))]
        public Nullable<int> DpTypeId { get; set; }

		[DataMember, Display(Name = "FixPattern", ResourceType = typeof(Resources.ReceiveItemResource))]
        public string FixPattern { get; set; }

		[ForeignKey("ToJobSite")]
		[DataMember, Display(Name = "ToJobSiteId", ResourceType = typeof(Resources.ReceiveItemResource))]
        public Nullable<int> ToJobSiteId { get; set; }

		[DataMember, Display(Name = "IsAssetBelow", ResourceType = typeof(Resources.ReceiveItemResource))]
        public string IsAssetBelow { get; set; }

		[DataMember, Display(Name = "Descr", ResourceType = typeof(Resources.ReceiveItemResource))]
        public string Descr { get; set; }

		[DataMember, Display(Name = "Qty", ResourceType = typeof(Resources.ReceiveItemResource))]
        public Nullable<int> Qty { get; set; }

		[DataMember, Display(Name = "Price", ResourceType = typeof(Resources.ReceiveItemResource))]
        public Nullable<double> Price { get; set; }

		[DataMember, Display(Name = "Accessary", ResourceType = typeof(Resources.ReceiveItemResource))]
        public string Accessary { get; set; }

		[DataMember, Display(Name = "PicturePath", ResourceType = typeof(Resources.ReceiveItemResource))]
        public string PicturePath { get; set; }

		[DataMember, Display(Name = "Remarks", ResourceType = typeof(Resources.ReceiveItemResource))]
        public string Remarks { get; set; }

		[DataMember, Display(Name = "RecordStatus", ResourceType = typeof(Resources.ReceiveItemResource))]
        public string RecordStatus { get; set; }

		[DataMember, Display(Name = "CreatedBy", ResourceType = typeof(Resources.ReceiveItemResource))]
        public Nullable<int> CreatedBy { get; set; }

		[DataMember, Display(Name = "CreatedWhen", ResourceType = typeof(Resources.ReceiveItemResource))]
        public Nullable<System.DateTime> CreatedWhen { get; set; }

		[DataMember, Display(Name = "UpdatedBy", ResourceType = typeof(Resources.ReceiveItemResource))]
        public Nullable<int> UpdatedBy { get; set; }

		[DataMember, Display(Name = "UpdatedWhen", ResourceType = typeof(Resources.ReceiveItemResource))]
        public Nullable<System.DateTime> UpdatedWhen { get; set; }

        [DataMember]
        public virtual ICollection<ReceiveItem> ReceiveItems { get; set; }

        [DataMember]
        public virtual Received Receive { get; set; }

        public virtual DeliveryNoteItem DeliveryNoteItem { get; set; }

		public virtual MasResourceItem UpperIcmRcItem { get; set; }

        public virtual MasDepreciationType MasDepreciationType { get; set; }

		public virtual HRM.JobSite ToJobSite { get; set; }

    }
}